/**
 * 用户表 api 封装
 *
 * @Author:    zhoujk
 * @Date:      2025-01-23 04:08:29
 */
import { postRequest } from '/src/lib/axios'

export const userApi = {
  /**
   * 查询列表
   */
  list: (param) => {
    return postRequest('/b-agent/user/list', param)
  },

  /**
   * 分页查询
   */
  page: (param) => {
    return postRequest('/b-agent/user/page', param)
  },

  /**
   * 增加
   */
  insert: (param) => {
    return postRequest('/b-agent/user/insert', param)
  },

  /**
   * 修改
   */
  update: (param) => {
    return postRequest('/b-agent/user/update', param)
  },

  /**
   * 修改用户状态
   */
  updateStatus: (param) => {
    return postRequest('/b-agent/user/update_status', param)
  },

  /**
   * 删除
   */
  delete: (param) => {
    return postRequest('/b-agent/user/delete', param)
  },

  /**
   * 分页查询
   */
  findOne: (param) => {
    return postRequest('/b-agent/user/find_id', param)
  },

  /**
   * 修改密码
   */
  updatePwd: (param) => {
    return postRequest('/b-agent/user/update_pwd', param)
  },

  /**
   * 重置密码
   */
  resetPwd: (param) => {
    return postRequest('/b-agent/user/reset_pwd', param)
  },

  /**
   * 批量插入用户角色
   */
  batchInsertRoleUser: (param) => {
    return postRequest('/b-agent/user/role/batch_insert', param)
  },

  /**
   * 删除用户角色
   */
  deleteUserRole: (param) => {
    return postRequest('/b-agent/user/role/delete', param)
  },
}
